#ifndef __TEST_H
#define __TEST_H

void testheap()
{
  srand(time(0));
  Heap<int> h(100);
  for(int i=0; i<10;i++)
    {
      int r = rand() % 100;
      h.insert(r);
    }
  for(int i=0; i<10;i++)
    {
      cout << "popped "<< h.pop() << "\n";
    }
}

void testhash()
{
  srand(time(0));
  HashTable<int> ht(1000);
  for(int i=0; i<10;i++)
    {
      int r = rand() % 100;
      cout << "Insert " << r <<" outcome "<< ht.insert(r, &r) << endl;
      cout << "Looking for "<<r<<" result is "<< *ht.lookup(r) << endl;
    }
  cout <<"*********"<<endl;
  for(int i=0; i<10;i++)
    {
      int r = rand() % 100;
      cout << "Looking for "<<r<<" result is "<< ht.lookup(r) << endl;
    }
}

void testconn()
{
  Connection c(1, "168.42.183.189", "196.232.20.73", 80);
  cout << "Connected " << c.Connect() << endl;
}

void testworker()
{
  Worker w;
  w.Run();
}

#endif
